package org.lt.cj.core;

import java.util.LinkedList;

public class Queue<T> {

    private LinkedList<T> queue = new LinkedList<T>();

    public T getT(int index) {
        return queue.get(index);
    }

    public void enQueue(T t) {
        queue.addLast(t);
    }

    public T deQueue() {
        return queue.removeFirst();
    }

    public int getCount() {
        return queue.size();
    }

    public boolean isQueueEmpty() {
        return queue.isEmpty();
    }

    public boolean contians(T t) {
        return queue.contains(t);
    }

    public boolean empty() {
        return queue.isEmpty();
    }

    public static void main(String[] args) {

        Queue<String> queue = new Queue<String>();
        queue.enQueue("hello,I am first");
        queue.enQueue("hello,I am second");
        queue.enQueue("damn,I am third");
        for (int i = 0; i < queue.getCount(); i++) {
            System.out.println("now:" + queue.getT(i) + "\n");
        }
    }
}
